﻿using System.Linq;
using Nb.Common.Hardwares;

namespace Nb.Common.MachineCodes
{
    public class MachineCodeService : IMachineCodeService
    {
        public string ReadCode()
        {
            var hardwareInfo = HardwareInfoFacade.ReadHardwareInfo();
            var hardwareSerialNumber = hardwareInfo.CpuSerialNumbers.OrderBy(x => x.Order).First();
            return hardwareSerialNumber.Number;
        }
    }
}